using System;
using System.Configuration;
using System.Web;
using System.Web.Security;

namespace CMS.Web
{
    public class BaseMasterPage : System.Web.UI.MasterPage
    {
        protected static string baseUrl;
        protected static string baseUrlWithOnlyID;
        protected static string imageUrl;
        /// <summary>
        /// 
        /// </summary>
        public BaseMasterPage()
        {
            baseUrl = SiteNavigation.GetRootPath();
            if (!baseUrl.EndsWith("/"))
            {
                baseUrl += "/";
            }
            //baseUrl = "http://" + HttpContext.Current.Request.Url.Host + ":" + HttpContext.Current.Request.Url.Port + HttpContext.Current.Request.ApplicationPath;
            //baseUrl += "/";

            string tabID = HttpContext.Current.Request.QueryString.Get("tabID");
            if (tabID == null) tabID = "";
            if ("".Equals(tabID))
                tabID = "1";
            baseUrlWithOnlyID = baseUrl + "?tabID=" + tabID;
            imageUrl = baseUrl + "Images/";
        }

        public string BaseURL
        {
            get
            {
                return baseUrl;
            }
        }

        public string BaseURLWithID
        {
            get
            {
                return baseUrlWithOnlyID;
            }
        }
        public string ImageUrl
        {
            get
            {
                return imageUrl;
            }
        }
    }
}
